package com.trkj.dao.jpa;



import java.math.BigDecimal;
import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;


import com.trkj.pojos.Tbstaffpower;
/**
 * 
 * @author lenovo
 *
 */
public interface IHwcStaffPowerDAO extends CrudRepository<Tbstaffpower, Long> {
	
	/**
	 * 根据员工编号查询权限编号(分页显示)
	 * @param staffNo
	 * @return
	 */
	@Query("select sp.powersNo from Tbstaffpower sp where staffNo = ?1")
	//public List<BigDecimal> queryStaffNoByPowersPage(Pageable pageble,BigDecimal staffNo);
	public List<BigDecimal> queryStaffNoByPowersPage(BigDecimal staffNo);
	
	/**
	 * 查询员工编号权限编号的组合对象
	 * @param powersNo
	 * @param staffNo
	 * @return
	 */
	@Query("select sp from Tbstaffpower sp where sp.powersNo = ?1 and sp.staffNo = ?2")
	public Tbstaffpower findPowerStaffSP(BigDecimal powersNo,BigDecimal staffNo);
	
}
